
local M = _G.CommonOHOH.class.new(script, script.Parent.base,"mall_handle_"..script.Name);
local ItemTool=_G.CommonOHOH.load.ItemTool();

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent)
end;

function M.dtor(self)
	M.super.dtor(self);
end;

--检查是否能够购买
function M.Check(self,gid,gtype)
    return true 
end

function M.IsMe(self,gid,gtype)
    return  script.Name==gtype
end

--服务器验证购买完成，处理发放逻辑
function M.ServerBuyDone(self,gid,...)
	local cfg=_G.CommonOHOH.config.Goods[gid]
    for k,v in pairs(cfg.itemData) do
        ItemTool.SaveData(k,self.DataBase,v)	
    end
	self.DataBase:Execut(function()
	end);
	self.parent:SynchDataToClient("weapon")
end

return M